$(function ()
{
    findMsg();
})

function findMsg()
{
    let data = fontAjax('/projectServer', {}, 'get');

    let showModel = data.model;
    let productTypeList = data.productTypeList;
    let productList = data.productList;

    let productTypeName = '';
    let product = '';

    if (showModel != null)
    {
        $('#bigTitle').html('<a href="/html/projectServer.html">' + showModel.bigTitle + '</a>');
        $('#smallTitle').html(showModel.smallTitle);
        $('#rephone').html(showModel.reservationPhone);
    }

    if (productTypeList != null)
    {
        for (let i = 0; i < productTypeList.length; i++)
        {
            if (i < 5)
            {
                productTypeName += '<div>' + productTypeList[i].productType + '</div>';
            }
        }
    }

    if (productList != null)
    {
        for (let i = 0; i < productList.length; i++)
        {
            product += '<div>\n' +
                '                            <div><img src="' + productList[i].img + '" height="232" width="300"/></div>\n' +
                '                            <div>\n' +
                '                                <div>' + productList[i].productName + '</div>\n' +
                '                                <div>\n' +
                '                                    <div>价格:</div>\n' +
                '                                    <div>' + productList[i].price + '</div>\n' +
                '                                </div>\n' +
                '                            </div>\n' +
                '                        </div>';
        }
    }

    $('#productTypeName').html(productTypeName);
    $('#product').html(product);
}